Repository navigation
[Phase 4] - Remove module-level reportAttributesDerivedValue in isEmptyReport() - #100693
Conversation
e458a69 to
fbb6dab
Compare
Remove module-level reportAttributesDerivedValue read inside isEmptyReport() by accepting an optional derivedIsEmptyReport parameter, mirroring Phase 2's derivedReportName pattern. - Add reportIsEmptySelector to ReportAttributes selectors - Add useDerivedIsEmptyReport hook - Thread derivedIsEmptyReport through isUnread, reasonForReportToBeInOptionList, and ShouldReportBeInOptionListParams - Update call sites in SidebarUtils, OptionsListUtils, DebugUtils, MarkAllMessageAsRead, and components/hooks - Add tests for isEmptyReport cache hit/miss and new hook Part of Expensify#66427 (Phase 4)
fbb6dab to
a39db3c
Compare
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
# Conflicts: # src/libs/actions/Report/MarkAllMessageAsRead.tsx # src/pages/inbox/sidebar/InboxTabSelector.tsx
f809945 to
de2c474
Compare
…portBeInOptionList
de2c474 to
3c74c72
Compare
- Connect to DERIVED.REPORT_ATTRIBUTES Onyx key - Pass derivedIsEmptyReport to isUnread and shouldReportBeInOptionList
d68996c to
1981a18
Compare
|
@DylanDylann Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
This PR adds a new |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1981a189a8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
No product review needed. |
| let reportAttributesDerived: ReportAttributesDerivedValue['reports'] | undefined; | ||
| Onyx.connectWithoutView({ |
There was a problem hiding this comment.
Can you please leave a clear comment why its fine to use it here? thanks
There was a problem hiding this comment.
Yes, I done in a24baed and added comment explaining this subscription updates the unread indicator count, which is not linked to UI and doesn't update any UI state
Slack discussion here https://expensify.slack.com/archives/C08CZDJFJ77/p1789124171552799 |
|
And more |
|
This PR adds a new |
| triggerUnreadUpdate(); | ||
| }); | ||
|
|
||
| export default {getUnreadReportsForUnreadIndicator}; |
There was a problem hiding this comment.
@hoangzinh Could we remove this export (it's not used anywhere) to prevent someone from reusing this function elsewhere?
There was a problem hiding this comment.
it's used in tests/unit/UnreadIndicatorUpdaterTest.ts I guess we should leave it as it is
Reviewer Checklist
Screenshots/VideosScreen.Recording.2026-09-18.at.11.44.27.mov |
|
One NIT and failed ESLint check |
Variable was connected to Onyx but never read — isEmptyReport receives derivedIsEmptyReport as a parameter instead.
I fixed the failing ESLint checks |
mountiny
left a comment
There was a problem hiding this comment.
approving the connectWithoutView usage
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.90-0 🚀
|
|
🤖 No help site changes are required — no draft PR was created. This PR is an internal refactor with no user-facing behavior change, so nothing under Why I concluded no docs are neededWhat changed: [Phase 4] removes the module-level Checks I ran against the diff (21 files):
Linked issue: Remove The QA steps (LHN empty-chat filtering, the Unread tab, Mark all as read) all verify that existing behavior is preserved. Preserved behavior means the existing help articles are still accurate, so there is nothing to rewrite. One note on the sign-off you asked for: since no docs changes were required, there is no help site PR to link or mark @hoangzinh, please confirm that this PR is a behavior-preserving refactor. If any user-facing behavior did change, let me know what it is and I'll create the help site draft PR. |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.4.90-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Remove module-level
reportAttributesDerivedValueread insideisEmptyReport()by accepting anderivedIsEmptyReportparameter, mirroring Phase 2's derivedReportName pattern.reportIsEmptySelectorto ReportAttributes selectorsuseDerivedIsEmptyReporthookderivedIsEmptyReportthroughisUnread,reasonForReportToBeInOptionList, andShouldReportBeInOptionListParamsSidebarUtils,OptionsListUtils,DebugUtils,MarkAllMessageAsRead, and components/hooksFixed Issues
$ #66427
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
1. LHN displays reports correctly
2. Inbox Unread tab and Mark all as read
3. Report View — Chat navigates to unread position
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Screen.Recording.2026-09-06.195109.mp4